<template>
    <div id="box">
        <mt-header :title="titleText">
            <router-link :to="path" slot="left">
                <mt-button icon="back"></mt-button>
            </router-link>
            <img @click="$router.push(path)" class="icon-img" src="../../../static/img/home.png" alt="跳转商城" slot="right">
        </mt-header>
    </div>
</template>

<script>
export default {
    props:['titleText'],
    computed:{
        path(){
            if (this.titleText === '分类详情') return '/shop'
            if (this.titleText === '产品详情') return '/shop'
            if (this.titleText === '动态详情') return '/home'
            if (this.titleText === '地址编辑') return '/personal/concat'
            return '/personal'
        }
    }
}
</script>

<style scoped>
#box >>> .mint-header-title{
    font-size: 20px;
}

.icon-img{
    width: 25px;
    height: 25px;
}
#box >>> .mint-header{
    background: #717171;
}
</style>